/*********************************************************
          File Name:16.5.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sat 12 Dec 2015 01:31:17 PM CST
**********************************************************/

#include <iostream>
#include <string>

template<typename Type, size_t N>
void print(Type (&arr)[N])
{
        for(auto const &x: arr)
                std::cout << x << std::endl;
}

// or

/*
 * template<typename T>
 * void print(T &arr);
 */

int main(void)
{
        int a[] = {1, 2, 3, 4, 5};
        std::string s[] = {"this", "is", "a", "'string'"};
        const char *cs[] = {"this", "is", "a", "'const char []'"};

        print(a);
        print(s);
        print(cs);

        return 0;
}
